﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Main.master" AutoEventWireup="true" CodeBehind="BoMon.aspx.cs" Inherits="WTSQCB.BoMon" %>
<asp:Content ID="Content1" ContentPlaceHolderID="MainContent" runat="server">
    <p>
        &nbsp; Quản lý bộ môn</p>
    <p>
        &nbsp;
        Chọn Khoa:&nbsp;&nbsp;&nbsp;
        <asp:DropDownList ID="Khoaddl" runat="server" AutoPostBack="True" DataSourceID="SqlDataSource1" DataTextField="TenKhoa" DataValueField="MaKhoa">
        </asp:DropDownList>
    </p>
    <p>
        <asp:GridView ID="BoMondgv" runat="server" AllowPaging="True" AutoGenerateColumns="False" BackColor="White" BorderColor="#3366CC" BorderStyle="None" BorderWidth="1px" CellPadding="4" DataKeyNames="MaBoMon" DataSourceID="SqlDataSource2" OnSelectedIndexChanged="BoMondgv_SelectedIndexChanged" Width="980px">
            <Columns>
                <asp:CommandField ButtonType="Button" SelectText="CHỌN" ShowSelectButton="True" />
                <asp:BoundField DataField="MaBoMon" HeaderText="Mã bộ môn" ReadOnly="True" SortExpression="MaBoMon" />
                <asp:BoundField DataField="TenBoMon" HeaderText="Tên bộ môn" SortExpression="TenBoMon" />
                <asp:BoundField DataField="TenKhoa" HeaderText="Tên khoa" SortExpression="TenKhoa" />
            </Columns>
            <FooterStyle BackColor="#99CCCC" ForeColor="#003399" />
            <HeaderStyle BackColor="#003399" Font-Bold="True" ForeColor="#CCCCFF" />
            <PagerStyle BackColor="#99CCCC" ForeColor="#003399" HorizontalAlign="Left" />
            <RowStyle BackColor="White" ForeColor="#003399" />
            <SelectedRowStyle BackColor="#009999" Font-Bold="True" ForeColor="#CCFF99" />
            <SortedAscendingCellStyle BackColor="#EDF6F6" />
            <SortedAscendingHeaderStyle BackColor="#0D4AC4" />
            <SortedDescendingCellStyle BackColor="#D6DFDF" />
            <SortedDescendingHeaderStyle BackColor="#002876" />
        </asp:GridView>
    </p>
    <p>
        &nbsp;
        <asp:Button ID="Thembtn" runat="server" OnClick="Thembtn_Click" Text="THÊM" Width="80px" />
        &nbsp;
        <asp:Button ID="Suabtn" runat="server" OnClick="Suabtn_Click" Text="SỬA" Width="80px" />
        &nbsp;
        <asp:Button ID="Xoabtn" runat="server" OnClick="Xoabtn_Click" OnClientClick="return confirm('Bạn có muốn XÓA không ?')" Text="XÓA" Width="80px" />
    </p>
    <p>
        &nbsp;
        Thông tin chi tiết:</p>
    <p>
        &nbsp;
        Mã bộ môn:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
        <asp:TextBox ID="MaBoMontxt" runat="server" Width="200px"></asp:TextBox>
        <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="MaBoMontxt" ErrorMessage="RequiredFieldValidator" ForeColor="Red">Mã bộ môn không được để trống</asp:RequiredFieldValidator>
    </p>
    <p>
        &nbsp;
        Tên bộ môn:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
        <asp:TextBox ID="TenBoMontxt" runat="server" Width="200px"></asp:TextBox>
        <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ControlToValidate="TenBoMontxt" ErrorMessage="RequiredFieldValidator" ForeColor="Red">Tên bộ môn không được để trống</asp:RequiredFieldValidator>
    </p>
    <p>
        <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:WebDiemTSQCBConnectionString %>" SelectCommand="SELECT * FROM [Khoa]"></asp:SqlDataSource>
        <asp:SqlDataSource ID="SqlDataSource2" runat="server" ConnectionString="<%$ ConnectionStrings:WebDiemTSQCBConnectionString %>" SelectCommand="BoMonLoad" SelectCommandType="StoredProcedure">
            <SelectParameters>
                <asp:ControlParameter ControlID="Khoaddl" Name="makhoa" PropertyName="SelectedValue" Type="String" />
            </SelectParameters>
        </asp:SqlDataSource>
    </p>
</asp:Content>
